package com.example.huizhou.Service;

import com.example.huizhou.bean.Student;
import com.example.huizhou.bean.Teacher;
import com.example.huizhou.mapper.StudentMapper;
import com.example.huizhou.mapper.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    StudentMapper studentMapper;

    public void delete(int id){
        studentMapper.delete(id);
    }

    public void add(int Id,String studentID,String name,String password,String sex,String major,String classname,String year,String faculty){
        studentMapper.add(Id, studentID, name, password, sex, major, classname, year, faculty);
    }


    public List<Student> findAll()
    {
        List<Student> students=studentMapper.findAll();
        return students;
    }
    public void save(Student student)
    {
        studentMapper.save(student);
    }
    public String findsd(String studentID){
        String psw = studentMapper.findsd(studentID);
        return psw;
    }
    public Student findxs(String studentID){
        Student student = studentMapper.findxs(studentID);
        return student;
    }
    public void updatepsw(String studentID,String newpsw){
        studentMapper.updatepsw(studentID,newpsw);
    }
}
